#ifndef _INC_EVENT_H
#define _INC_EVENT_H
// ############################################################################
// ****************************************************************************
//              Copyright (C) 2000-2, Advantech Automation Corp.
//      THIS IS AN UNPUBLISHED WORK CONTAINING CONFIDENTIAL AND PROPRIETARY
//         INFORMATION WHICH IS THE PROHERTY OF ADVANTECH AUTOMATION CORP.
// 
//   ANY DISCLOSURE, USE, OR REPRODUCTION, WITHOUT WRITTEN AUTHORIZATION FROM
//             ADVANTECH AUTOMATION CORP., IS STRICTLY PROHIBITED
// ****************************************************************************
// ############################################################################
//
// File:        EVENT.H
// Created:     11/07/2002
// Description: Event type definition headfile.
// ============================================================================
// VERSION HISTORY
// 11/07/2002  Create
// 12/24/2002  Update for Version 2.0B 
// ============================================================================
// Notes:
// 1. Bit-mapped ID:
//    From 0x0001 to 0x0200 : defined at Driver.h, BIT-mapped Event ID.
//    From 0x0201 to 0x0205 : defined at Driver.h  ID-mapped Event ID.
//    From 0x0206 to 0x0fff : not used
//    From 0x1000 to 0xffff : defined at Event.h   ID-mapped Event ID.
//
// 2. Version 2.0A and before don't use Event.h.
//
// 3. EventID = 0x0000 is reserved for non event or error.
//    EventID = 0xffff is reserved for time out.
//
// 4. The sub event naming standard from 0x1000 to 0x6fff: 
//      0x1000 ~ 0x1fff    for AI Event Group
//         0x1000 ~ 0x17ff for General AI Event ID
//         0x1800 ~ 0x18ff for AI others Event ID
//      0x2000 ~ 0x2fff    for AO Event Group
//         0x2000 ~ 0x27ff for General AO Event ID
//         0x2800 ~ 0x28ff for AO others Event ID
//      0x3000 ~ 0x3fff    for DI Event Group
//         0x3000 ~ 0x30ff for General DI Event ID
//         0x3400 ~ 0x34ff for General IDI Event ID
//         0x3800 ~ 0x3fff for others Event ID
//      0x4000 ~ 0x4fff for DO Event Group
//         0x4000 ~ 0x47ff for DO Gernal Event ID
//         0x4800 ~ 0x48ff for DO others Event ID
//      0x5000 ~ 0x5fff for Counter/Timer Event Group
//         0x5000 ~ 0x50ff for Counter TC Event ID
//         0x5100 ~ 0x51ff for counter OverFlow Event ID
//         0x5200 ~ 0x52ff for counter UnderFlow Event ID
//         0x5300 ~ 0x53ff for counter OverCompare Event ID
//         0x5400 ~ 0x54ff for counter UnderCompare Event ID
//         0x5500 ~ 0x55ff for General Timer Event ID
//         0x5800 ~ 0x58ff for Counter/Timer others Event ID
//      0x6000 ~ 0x6fff not used at Version 2.0B


// ==================================
// 0x0000 and 0xffff
// ----------------------------------
#define  ADS_EVT_NO_EVENT             0x0000
#define  ADS_EVT_TIME_OUT             0xffff

// ==================================
// 0x1000 ~ 0x1fff for AI Group Event
// ----------------------------------
//sub group 0x1800 ~ 0x18ff for AI others Event ID
#define  ADS_EVT_AI_BUFFER1_FULL      0x1800
#define  ADS_EVT_AI_BUFFER2_FULL      0x1801

#define     ADS_EVT_AI_BUFFER1_FULL_NAME	    "ADS_EVT_AI_BUFFER1_FULL"
#define     ADS_EVT_AI_BUFFER2_FULL_NAME	    "ADS_EVT_AI_BUFFER2_FULL"

// ----------------------------------
// 0x2000 ~ 0x2fff for AO Group Event
// ----------------------------------
// sub group 0x2800 ~ 0x28ff for AO oters Event ID
#define  ADS_EVT_AO_BUFFER1_EMPTY     0x2800
#define  ADS_EVT_AO_BUFFER2_EMPTY     0x2801
#define  ADS_EVT_AO_INTERRUPT         0X2802    // for ao interrupt
#define  ADS_EVT_AO_BUFCHANGE         0x2803    // for ao buffer change
#define  ADS_EVT_AO_TERMINATED        0x2804    // for ao termination
#define  ADS_EVT_AO_UNDERRUN          0x2805    // for ao underrun
#define  ADS_EVT_AO_HIBUF_TRANSFERED  0x2806
#define  ADS_EVT_AO_LOBUF_TRANSFERED  0x2807

#define     ADS_EVT_AO_BUFFER1_EMPTY_NAME	     "ADS_EVT_AO_BUFFER1_EMPTY"
#define     ADS_EVT_AO_BUFFER2_EMPTY_NAME	     "ADS_EVT_AO_BUFFER2_EMPTY"
#define     ADS_EVT_AO_INTERRUPT_NAME          "ADS_EVT_AO_INTERRUPT"
#define     ADS_EVT_AO_BUFCHANGE_NAME          "ADS_EVT_AO_BUFCHANGE"
#define     ADS_EVT_AO_TERMINATED_NAME         "ADS_EVT_AO_TERMINATED"
#define     ADS_EVT_AO_UNDERRUN_NAME           "ADS_EVT_AO_UNDERRUN"
#define     ADS_EVT_AO_HIBUF_TRANSFERED_NAME   "ADS_EVT_AO_HIBUF_TRANSFERED"
#define     ADS_EVT_AO_LOBUF_TRANSFERED_NAME   "ADS_EVT_AO_LOBUF_TRANSFERED"


// ----------------------------------
// 0x3000 ~ 0x3fff for DI Group Event
// ----------------------------------
// sub group 0x3000 ~ 0x30ff for General DI Event ID
#define  ADS_EVT_INTERRUPT_DI0        0x3000
#define  ADS_EVT_INTERRUPT_DI1        (ADS_EVT_INTERRUPT_DI0 + 1)
#define  ADS_EVT_INTERRUPT_DI2        (ADS_EVT_INTERRUPT_DI0 + 2)
#define  ADS_EVT_INTERRUPT_DI3        (ADS_EVT_INTERRUPT_DI0 + 3)
#define  ADS_EVT_INTERRUPT_DI4        (ADS_EVT_INTERRUPT_DI0 + 4)
#define  ADS_EVT_INTERRUPT_DI5        (ADS_EVT_INTERRUPT_DI0 + 5)
#define  ADS_EVT_INTERRUPT_DI6        (ADS_EVT_INTERRUPT_DI0 + 6)
#define  ADS_EVT_INTERRUPT_DI7        (ADS_EVT_INTERRUPT_DI0 + 7)
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\2.2//////////////////////////////////
#define  ADS_EVT_INTERRUPT_DI8        (ADS_EVT_INTERRUPT_DI0 + 8)
#define  ADS_EVT_INTERRUPT_DI9        (ADS_EVT_INTERRUPT_DI0 + 9)
#define  ADS_EVT_INTERRUPT_DI10       (ADS_EVT_INTERRUPT_DI0 + 10)
#define  ADS_EVT_INTERRUPT_DI11       (ADS_EVT_INTERRUPT_DI0 + 11)
#define  ADS_EVT_INTERRUPT_DI12       (ADS_EVT_INTERRUPT_DI0 + 12)
#define  ADS_EVT_INTERRUPT_DI13       (ADS_EVT_INTERRUPT_DI0 + 13)
#define  ADS_EVT_INTERRUPT_DI14       (ADS_EVT_INTERRUPT_DI0 + 14)
#define  ADS_EVT_INTERRUPT_DI15       (ADS_EVT_INTERRUPT_DI0 + 15)

#define  ADS_EVT_INTERRUPT_DI16       (ADS_EVT_INTERRUPT_DI0 + 16)
#define  ADS_EVT_INTERRUPT_DI17       (ADS_EVT_INTERRUPT_DI0 + 17)
#define  ADS_EVT_INTERRUPT_DI18       (ADS_EVT_INTERRUPT_DI0 + 18)
#define  ADS_EVT_INTERRUPT_DI19       (ADS_EVT_INTERRUPT_DI0 + 19)
#define  ADS_EVT_INTERRUPT_DI20       (ADS_EVT_INTERRUPT_DI0 + 20)
#define  ADS_EVT_INTERRUPT_DI21       (ADS_EVT_INTERRUPT_DI0 + 21)
#define  ADS_EVT_INTERRUPT_DI22       (ADS_EVT_INTERRUPT_DI0 + 22)
#define  ADS_EVT_INTERRUPT_DI23       (ADS_EVT_INTERRUPT_DI0 + 23)

#define  ADS_EVT_INTERRUPT_DI24       (ADS_EVT_INTERRUPT_DI0 + 24)
#define  ADS_EVT_INTERRUPT_DI25       (ADS_EVT_INTERRUPT_DI0 + 25)
#define  ADS_EVT_INTERRUPT_DI26       (ADS_EVT_INTERRUPT_DI0 + 26)
#define  ADS_EVT_INTERRUPT_DI27       (ADS_EVT_INTERRUPT_DI0 + 27)
#define  ADS_EVT_INTERRUPT_DI28       (ADS_EVT_INTERRUPT_DI0 + 28)
#define  ADS_EVT_INTERRUPT_DI29       (ADS_EVT_INTERRUPT_DI0 + 29)
#define  ADS_EVT_INTERRUPT_DI30       (ADS_EVT_INTERRUPT_DI0 + 30)
#define  ADS_EVT_INTERRUPT_DI31       (ADS_EVT_INTERRUPT_DI0 + 31)

#define  ADS_EVT_INTERRUPT_DI32       (ADS_EVT_INTERRUPT_DI0 + 32)
#define  ADS_EVT_INTERRUPT_DI33       (ADS_EVT_INTERRUPT_DI0 + 33)
#define  ADS_EVT_INTERRUPT_DI34       (ADS_EVT_INTERRUPT_DI0 + 34)
#define  ADS_EVT_INTERRUPT_DI35       (ADS_EVT_INTERRUPT_DI0 + 35)
#define  ADS_EVT_INTERRUPT_DI36       (ADS_EVT_INTERRUPT_DI0 + 36)
#define  ADS_EVT_INTERRUPT_DI37       (ADS_EVT_INTERRUPT_DI0 + 37)
#define  ADS_EVT_INTERRUPT_DI38       (ADS_EVT_INTERRUPT_DI0 + 38)
#define  ADS_EVT_INTERRUPT_DI39       (ADS_EVT_INTERRUPT_DI0 + 39)

#define  ADS_EVT_INTERRUPT_DI40       (ADS_EVT_INTERRUPT_DI0 + 40)
#define  ADS_EVT_INTERRUPT_DI41       (ADS_EVT_INTERRUPT_DI0 + 41)
#define  ADS_EVT_INTERRUPT_DI42       (ADS_EVT_INTERRUPT_DI0 + 42)
#define  ADS_EVT_INTERRUPT_DI43       (ADS_EVT_INTERRUPT_DI0 + 43)
#define  ADS_EVT_INTERRUPT_DI44       (ADS_EVT_INTERRUPT_DI0 + 44)
#define  ADS_EVT_INTERRUPT_DI45       (ADS_EVT_INTERRUPT_DI0 + 45)
#define  ADS_EVT_INTERRUPT_DI46       (ADS_EVT_INTERRUPT_DI0 + 46)
#define  ADS_EVT_INTERRUPT_DI47       (ADS_EVT_INTERRUPT_DI0 + 47)

#define  ADS_EVT_INTERRUPT_DI48       (ADS_EVT_INTERRUPT_DI0 + 48)
#define  ADS_EVT_INTERRUPT_DI49       (ADS_EVT_INTERRUPT_DI0 + 49)
#define  ADS_EVT_INTERRUPT_DI50       (ADS_EVT_INTERRUPT_DI0 + 50)
#define  ADS_EVT_INTERRUPT_DI51       (ADS_EVT_INTERRUPT_DI0 + 51)
#define  ADS_EVT_INTERRUPT_DI52       (ADS_EVT_INTERRUPT_DI0 + 52)
#define  ADS_EVT_INTERRUPT_DI53       (ADS_EVT_INTERRUPT_DI0 + 53)
#define  ADS_EVT_INTERRUPT_DI54       (ADS_EVT_INTERRUPT_DI0 + 54)
#define  ADS_EVT_INTERRUPT_DI55       (ADS_EVT_INTERRUPT_DI0 + 55)

#define  ADS_EVT_INTERRUPT_DI56       (ADS_EVT_INTERRUPT_DI0 + 56)
#define  ADS_EVT_INTERRUPT_DI57       (ADS_EVT_INTERRUPT_DI0 + 57)
#define  ADS_EVT_INTERRUPT_DI58       (ADS_EVT_INTERRUPT_DI0 + 58)
#define  ADS_EVT_INTERRUPT_DI59       (ADS_EVT_INTERRUPT_DI0 + 59)
#define  ADS_EVT_INTERRUPT_DI60       (ADS_EVT_INTERRUPT_DI0 + 60)
#define  ADS_EVT_INTERRUPT_DI61       (ADS_EVT_INTERRUPT_DI0 + 61)
#define  ADS_EVT_INTERRUPT_DI62       (ADS_EVT_INTERRUPT_DI0 + 62)
#define  ADS_EVT_INTERRUPT_DI63       (ADS_EVT_INTERRUPT_DI0 + 63)

#define  ADS_EVT_INTERRUPT_DI64       (ADS_EVT_INTERRUPT_DI0 + 64)
#define  ADS_EVT_INTERRUPT_DI65       (ADS_EVT_INTERRUPT_DI0 + 65)
#define  ADS_EVT_INTERRUPT_DI66       (ADS_EVT_INTERRUPT_DI0 + 66)
#define  ADS_EVT_INTERRUPT_DI67       (ADS_EVT_INTERRUPT_DI0 + 67)
#define  ADS_EVT_INTERRUPT_DI68       (ADS_EVT_INTERRUPT_DI0 + 68)
#define  ADS_EVT_INTERRUPT_DI69       (ADS_EVT_INTERRUPT_DI0 + 69)
#define  ADS_EVT_INTERRUPT_DI70       (ADS_EVT_INTERRUPT_DI0 + 70)
#define  ADS_EVT_INTERRUPT_DI71       (ADS_EVT_INTERRUPT_DI0 + 71)

#define  ADS_EVT_INTERRUPT_DI72       (ADS_EVT_INTERRUPT_DI0 + 72)
#define  ADS_EVT_INTERRUPT_DI73       (ADS_EVT_INTERRUPT_DI0 + 73)
#define  ADS_EVT_INTERRUPT_DI74       (ADS_EVT_INTERRUPT_DI0 + 74)
#define  ADS_EVT_INTERRUPT_DI75       (ADS_EVT_INTERRUPT_DI0 + 75)
#define  ADS_EVT_INTERRUPT_DI76       (ADS_EVT_INTERRUPT_DI0 + 76)
#define  ADS_EVT_INTERRUPT_DI77       (ADS_EVT_INTERRUPT_DI0 + 77)
#define  ADS_EVT_INTERRUPT_DI78       (ADS_EVT_INTERRUPT_DI0 + 78)
#define  ADS_EVT_INTERRUPT_DI79       (ADS_EVT_INTERRUPT_DI0 + 79)

#define  ADS_EVT_INTERRUPT_DI80       (ADS_EVT_INTERRUPT_DI0 + 80)
#define  ADS_EVT_INTERRUPT_DI81       (ADS_EVT_INTERRUPT_DI0 + 81)
#define  ADS_EVT_INTERRUPT_DI82       (ADS_EVT_INTERRUPT_DI0 + 82)
#define  ADS_EVT_INTERRUPT_DI83       (ADS_EVT_INTERRUPT_DI0 + 83)
#define  ADS_EVT_INTERRUPT_DI84       (ADS_EVT_INTERRUPT_DI0 + 84)
#define  ADS_EVT_INTERRUPT_DI85       (ADS_EVT_INTERRUPT_DI0 + 85)
#define  ADS_EVT_INTERRUPT_DI86       (ADS_EVT_INTERRUPT_DI0 + 86)
#define  ADS_EVT_INTERRUPT_DI87       (ADS_EVT_INTERRUPT_DI0 + 87)

#define  ADS_EVT_INTERRUPT_DI88       (ADS_EVT_INTERRUPT_DI0 + 88)
#define  ADS_EVT_INTERRUPT_DI89       (ADS_EVT_INTERRUPT_DI0 + 89)
#define  ADS_EVT_INTERRUPT_DI90       (ADS_EVT_INTERRUPT_DI0 + 90)
#define  ADS_EVT_INTERRUPT_DI91       (ADS_EVT_INTERRUPT_DI0 + 91)
#define  ADS_EVT_INTERRUPT_DI92       (ADS_EVT_INTERRUPT_DI0 + 92)
#define  ADS_EVT_INTERRUPT_DI93       (ADS_EVT_INTERRUPT_DI0 + 93)
#define  ADS_EVT_INTERRUPT_DI94       (ADS_EVT_INTERRUPT_DI0 + 94)
#define  ADS_EVT_INTERRUPT_DI95       (ADS_EVT_INTERRUPT_DI0 + 95)

#define  ADS_EVT_INTERRUPT_DI96       (ADS_EVT_INTERRUPT_DI0 + 96)
#define  ADS_EVT_INTERRUPT_DI97       (ADS_EVT_INTERRUPT_DI0 + 97)
#define  ADS_EVT_INTERRUPT_DI98       (ADS_EVT_INTERRUPT_DI0 + 98)
#define  ADS_EVT_INTERRUPT_DI99       (ADS_EVT_INTERRUPT_DI0 + 99)
#define  ADS_EVT_INTERRUPT_DI100      (ADS_EVT_INTERRUPT_DI0 + 100)
#define  ADS_EVT_INTERRUPT_DI101      (ADS_EVT_INTERRUPT_DI0 + 101)
#define  ADS_EVT_INTERRUPT_DI102      (ADS_EVT_INTERRUPT_DI0 + 102)
#define  ADS_EVT_INTERRUPT_DI103      (ADS_EVT_INTERRUPT_DI0 + 103)

#define  ADS_EVT_INTERRUPT_DI104      (ADS_EVT_INTERRUPT_DI0 + 104)
#define  ADS_EVT_INTERRUPT_DI105      (ADS_EVT_INTERRUPT_DI0 + 105)
#define  ADS_EVT_INTERRUPT_DI106      (ADS_EVT_INTERRUPT_DI0 + 106)
#define  ADS_EVT_INTERRUPT_DI107      (ADS_EVT_INTERRUPT_DI0 + 107)
#define  ADS_EVT_INTERRUPT_DI108      (ADS_EVT_INTERRUPT_DI0 + 108)
#define  ADS_EVT_INTERRUPT_DI109      (ADS_EVT_INTERRUPT_DI0 + 109)
#define  ADS_EVT_INTERRUPT_DI110      (ADS_EVT_INTERRUPT_DI0 + 110)
#define  ADS_EVT_INTERRUPT_DI111      (ADS_EVT_INTERRUPT_DI0 + 111)

#define  ADS_EVT_INTERRUPT_DI112      (ADS_EVT_INTERRUPT_DI0 + 112)
#define  ADS_EVT_INTERRUPT_DI113      (ADS_EVT_INTERRUPT_DI0 + 113)
#define  ADS_EVT_INTERRUPT_DI114      (ADS_EVT_INTERRUPT_DI0 + 114)
#define  ADS_EVT_INTERRUPT_DI115      (ADS_EVT_INTERRUPT_DI0 + 115)
#define  ADS_EVT_INTERRUPT_DI116      (ADS_EVT_INTERRUPT_DI0 + 116)
#define  ADS_EVT_INTERRUPT_DI117      (ADS_EVT_INTERRUPT_DI0 + 117)
#define  ADS_EVT_INTERRUPT_DI118      (ADS_EVT_INTERRUPT_DI0 + 118)
#define  ADS_EVT_INTERRUPT_DI119      (ADS_EVT_INTERRUPT_DI0 + 119)

#define  ADS_EVT_INTERRUPT_DI120      (ADS_EVT_INTERRUPT_DI0 + 120)
#define  ADS_EVT_INTERRUPT_DI121      (ADS_EVT_INTERRUPT_DI0 + 121)
#define  ADS_EVT_INTERRUPT_DI122      (ADS_EVT_INTERRUPT_DI0 + 122)
#define  ADS_EVT_INTERRUPT_DI123      (ADS_EVT_INTERRUPT_DI0 + 123)
#define  ADS_EVT_INTERRUPT_DI124      (ADS_EVT_INTERRUPT_DI0 + 124)
#define  ADS_EVT_INTERRUPT_DI125      (ADS_EVT_INTERRUPT_DI0 + 125)
#define  ADS_EVT_INTERRUPT_DI126      (ADS_EVT_INTERRUPT_DI0 + 126)
#define  ADS_EVT_INTERRUPT_DI127      (ADS_EVT_INTERRUPT_DI0 + 127)
///////////////////////////////2.2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//  ...  ...
#define     ADS_EVT_INTERRUPT_DI0_NAME		   "ADS_EVT_INTERRUPT_DI0"
#define     ADS_EVT_INTERRUPT_DI1_NAME		   "ADS_EVT_INTERRUPT_DI1"
#define     ADS_EVT_INTERRUPT_DI2_NAME		   "ADS_EVT_INTERRUPT_DI2"
#define     ADS_EVT_INTERRUPT_DI3_NAME		   "ADS_EVT_INTERRUPT_DI3"
#define     ADS_EVT_INTERRUPT_DI4_NAME		   "ADS_EVT_INTERRUPT_DI4"
#define     ADS_EVT_INTERRUPT_DI5_NAME		   "ADS_EVT_INTERRUPT_DI5"
#define     ADS_EVT_INTERRUPT_DI6_NAME		   "ADS_EVT_INTERRUPT_DI6"
#define     ADS_EVT_INTERRUPT_DI7_NAME		   "ADS_EVT_INTERRUPT_DI7"

// sub group 0x3400 ~ 0x37ff for General IDI Event ID
#define  ADS_EVT_INTERRUPT_IDI0       0x3400
#define  ADS_EVT_INTERRUPT_IDI1       (ADS_EVT_INTERRUPT_IDI0 + 1)
#define  ADS_EVT_INTERRUPT_IDI2       (ADS_EVT_INTERRUPT_IDI0 + 2)
#define  ADS_EVT_INTERRUPT_IDI3       (ADS_EVT_INTERRUPT_IDI0 + 3)
#define  ADS_EVT_INTERRUPT_IDI4       (ADS_EVT_INTERRUPT_IDI0 + 4)
#define  ADS_EVT_INTERRUPT_IDI5       (ADS_EVT_INTERRUPT_IDI0 + 5)
#define  ADS_EVT_INTERRUPT_IDI6       (ADS_EVT_INTERRUPT_IDI0 + 6)
#define  ADS_EVT_INTERRUPT_IDI7       (ADS_EVT_INTERRUPT_IDI0 + 7)



#define  ADS_EVT_INTERRUPT_IDI16      (ADS_EVT_INTERRUPT_IDI0 + 16)
#define  ADS_EVT_INTERRUPT_IDI17      (ADS_EVT_INTERRUPT_IDI0 + 17)

// New device driver structure.
#define ADS_EVT_DI_INTERRUPT0           0x3400
#define ADS_EVT_DI_INTERRUPT1          ( ADS_EVT_DI_INTERRUPT0  + 1 )
#define ADS_EVT_DI_INTERRUPT2          ( ADS_EVT_DI_INTERRUPT0  + 2 )
#define ADS_EVT_DI_INTERRUPT3          ( ADS_EVT_DI_INTERRUPT0  + 3 )
#define ADS_EVT_DI_INTERRUPT4          ( ADS_EVT_DI_INTERRUPT0  + 4 )
#define ADS_EVT_DI_INTERRUPT5          ( ADS_EVT_DI_INTERRUPT0  + 5 )
#define ADS_EVT_DI_INTERRUPT6          ( ADS_EVT_DI_INTERRUPT0  + 6 )
#define ADS_EVT_DI_INTERRUPT7          ( ADS_EVT_DI_INTERRUPT0  + 7 )

#define ADS_EVT_DI_INTERRUPT8           ( ADS_EVT_DI_INTERRUPT0  + 8 )
#define ADS_EVT_DI_INTERRUPT9           ( ADS_EVT_DI_INTERRUPT0  + 9 )
#define ADS_EVT_DI_INTERRUPT10          ( ADS_EVT_DI_INTERRUPT0  + 10 )
#define ADS_EVT_DI_INTERRUPT11          ( ADS_EVT_DI_INTERRUPT0  + 11 )
#define ADS_EVT_DI_INTERRUPT12          ( ADS_EVT_DI_INTERRUPT0  + 12 )
#define ADS_EVT_DI_INTERRUPT13          ( ADS_EVT_DI_INTERRUPT0  + 13 )
#define ADS_EVT_DI_INTERRUPT14          ( ADS_EVT_DI_INTERRUPT0  + 14 )
#define ADS_EVT_DI_INTERRUPT15          ( ADS_EVT_DI_INTERRUPT0  + 15 )

#define ADS_EVT_DI_INTERRUPT16          ( ADS_EVT_DI_INTERRUPT0  + 16 )
#define ADS_EVT_DI_INTERRUPT17          ( ADS_EVT_DI_INTERRUPT0  + 17 )
#define ADS_EVT_DI_INTERRUPT18          ( ADS_EVT_DI_INTERRUPT0  + 18 )
#define ADS_EVT_DI_INTERRUPT19          ( ADS_EVT_DI_INTERRUPT0  + 19 )
#define ADS_EVT_DI_INTERRUPT20          ( ADS_EVT_DI_INTERRUPT0  + 20 )
#define ADS_EVT_DI_INTERRUPT21          ( ADS_EVT_DI_INTERRUPT0  + 21 )
#define ADS_EVT_DI_INTERRUPT22          ( ADS_EVT_DI_INTERRUPT0  + 22 )
#define ADS_EVT_DI_INTERRUPT23          ( ADS_EVT_DI_INTERRUPT0  + 23 )

#define ADS_EVT_DI_INTERRUPT24          ( ADS_EVT_DI_INTERRUPT0  + 24 )
#define ADS_EVT_DI_INTERRUPT25          ( ADS_EVT_DI_INTERRUPT0  + 25 )
#define ADS_EVT_DI_INTERRUPT26          ( ADS_EVT_DI_INTERRUPT0  + 26 )
#define ADS_EVT_DI_INTERRUPT27          ( ADS_EVT_DI_INTERRUPT0  + 27 )
#define ADS_EVT_DI_INTERRUPT28          ( ADS_EVT_DI_INTERRUPT0  + 28 )
#define ADS_EVT_DI_INTERRUPT29          ( ADS_EVT_DI_INTERRUPT0  + 29 )
#define ADS_EVT_DI_INTERRUPT30          ( ADS_EVT_DI_INTERRUPT0  + 30 )
#define ADS_EVT_DI_INTERRUPT31          ( ADS_EVT_DI_INTERRUPT0  + 31 )

#define ADS_EVT_DI_INTERRUPT32          ( ADS_EVT_DI_INTERRUPT0  + 32 )
#define ADS_EVT_DI_INTERRUPT33          ( ADS_EVT_DI_INTERRUPT0  + 33 )
#define ADS_EVT_DI_INTERRUPT34          ( ADS_EVT_DI_INTERRUPT0  + 34 )
#define ADS_EVT_DI_INTERRUPT35          ( ADS_EVT_DI_INTERRUPT0  + 35 )
#define ADS_EVT_DI_INTERRUPT36          ( ADS_EVT_DI_INTERRUPT0  + 36 )
#define ADS_EVT_DI_INTERRUPT37          ( ADS_EVT_DI_INTERRUPT0  + 37 )
#define ADS_EVT_DI_INTERRUPT38          ( ADS_EVT_DI_INTERRUPT0  + 38 )
#define ADS_EVT_DI_INTERRUPT39          ( ADS_EVT_DI_INTERRUPT0  + 39 )

#define ADS_EVT_DI_INTERRUPT40          ( ADS_EVT_DI_INTERRUPT0  + 40 )
#define ADS_EVT_DI_INTERRUPT41          ( ADS_EVT_DI_INTERRUPT0  + 41 )
#define ADS_EVT_DI_INTERRUPT42          ( ADS_EVT_DI_INTERRUPT0  + 42 )
#define ADS_EVT_DI_INTERRUPT43          ( ADS_EVT_DI_INTERRUPT0  + 43 )
#define ADS_EVT_DI_INTERRUPT44          ( ADS_EVT_DI_INTERRUPT0  + 44 )
#define ADS_EVT_DI_INTERRUPT45          ( ADS_EVT_DI_INTERRUPT0  + 45 )
#define ADS_EVT_DI_INTERRUPT46          ( ADS_EVT_DI_INTERRUPT0  + 46 )
#define ADS_EVT_DI_INTERRUPT47          ( ADS_EVT_DI_INTERRUPT0  + 47 )

#define ADS_EVT_DI_INTERRUPT48          ( ADS_EVT_DI_INTERRUPT0  + 48 )
#define ADS_EVT_DI_INTERRUPT49          ( ADS_EVT_DI_INTERRUPT0  + 49 )
#define ADS_EVT_DI_INTERRUPT50          ( ADS_EVT_DI_INTERRUPT0  + 50 )
#define ADS_EVT_DI_INTERRUPT51          ( ADS_EVT_DI_INTERRUPT0  + 51 )
#define ADS_EVT_DI_INTERRUPT52          ( ADS_EVT_DI_INTERRUPT0  + 52 )
#define ADS_EVT_DI_INTERRUPT53          ( ADS_EVT_DI_INTERRUPT0  + 53 )
#define ADS_EVT_DI_INTERRUPT54          ( ADS_EVT_DI_INTERRUPT0  + 54 )
#define ADS_EVT_DI_INTERRUPT55          ( ADS_EVT_DI_INTERRUPT0  + 55 )

#define ADS_EVT_DI_INTERRUPT56          ( ADS_EVT_DI_INTERRUPT0  + 56 )
#define ADS_EVT_DI_INTERRUPT57          ( ADS_EVT_DI_INTERRUPT0  + 57 )
#define ADS_EVT_DI_INTERRUPT58          ( ADS_EVT_DI_INTERRUPT0  + 58 )
#define ADS_EVT_DI_INTERRUPT59          ( ADS_EVT_DI_INTERRUPT0  + 59 )
#define ADS_EVT_DI_INTERRUPT60          ( ADS_EVT_DI_INTERRUPT0  + 60 )
#define ADS_EVT_DI_INTERRUPT61          ( ADS_EVT_DI_INTERRUPT0  + 61 )
#define ADS_EVT_DI_INTERRUPT62          ( ADS_EVT_DI_INTERRUPT0  + 62 )
#define ADS_EVT_DI_INTERRUPT63          ( ADS_EVT_DI_INTERRUPT0  + 63 )

#define ADS_EVT_DI_INTERRUPT64          ( ADS_EVT_DI_INTERRUPT0  + 64 )
#define ADS_EVT_DI_INTERRUPT65          ( ADS_EVT_DI_INTERRUPT0  + 65 )
#define ADS_EVT_DI_INTERRUPT66          ( ADS_EVT_DI_INTERRUPT0  + 66 )
#define ADS_EVT_DI_INTERRUPT67          ( ADS_EVT_DI_INTERRUPT0  + 67 )
#define ADS_EVT_DI_INTERRUPT68          ( ADS_EVT_DI_INTERRUPT0  + 68 )
#define ADS_EVT_DI_INTERRUPT69          ( ADS_EVT_DI_INTERRUPT0  + 69 )
#define ADS_EVT_DI_INTERRUPT70          ( ADS_EVT_DI_INTERRUPT0  + 70 )
#define ADS_EVT_DI_INTERRUPT71          ( ADS_EVT_DI_INTERRUPT0  + 71 )

#define ADS_EVT_DI_INTERRUPT72          ( ADS_EVT_DI_INTERRUPT0  + 72 )
#define ADS_EVT_DI_INTERRUPT73          ( ADS_EVT_DI_INTERRUPT0  + 73 )
#define ADS_EVT_DI_INTERRUPT74          ( ADS_EVT_DI_INTERRUPT0  + 74 )
#define ADS_EVT_DI_INTERRUPT75          ( ADS_EVT_DI_INTERRUPT0  + 75 )
#define ADS_EVT_DI_INTERRUPT76          ( ADS_EVT_DI_INTERRUPT0  + 76 )
#define ADS_EVT_DI_INTERRUPT77          ( ADS_EVT_DI_INTERRUPT0  + 77 )
#define ADS_EVT_DI_INTERRUPT78          ( ADS_EVT_DI_INTERRUPT0  + 78 )
#define ADS_EVT_DI_INTERRUPT79          ( ADS_EVT_DI_INTERRUPT0  + 79 )

#define ADS_EVT_DI_INTERRUPT80          ( ADS_EVT_DI_INTERRUPT0  + 80 )
#define ADS_EVT_DI_INTERRUPT81          ( ADS_EVT_DI_INTERRUPT0  + 81 )
#define ADS_EVT_DI_INTERRUPT82          ( ADS_EVT_DI_INTERRUPT0  + 82 )
#define ADS_EVT_DI_INTERRUPT83          ( ADS_EVT_DI_INTERRUPT0  + 83 )
#define ADS_EVT_DI_INTERRUPT84          ( ADS_EVT_DI_INTERRUPT0  + 84 )
#define ADS_EVT_DI_INTERRUPT85          ( ADS_EVT_DI_INTERRUPT0  + 85 )
#define ADS_EVT_DI_INTERRUPT86          ( ADS_EVT_DI_INTERRUPT0  + 86 )
#define ADS_EVT_DI_INTERRUPT87          ( ADS_EVT_DI_INTERRUPT0  + 87 )

#define ADS_EVT_DI_INTERRUPT88          ( ADS_EVT_DI_INTERRUPT0  + 88 )
#define ADS_EVT_DI_INTERRUPT89          ( ADS_EVT_DI_INTERRUPT0  + 89 )
#define ADS_EVT_DI_INTERRUPT90          ( ADS_EVT_DI_INTERRUPT0  + 90 )
#define ADS_EVT_DI_INTERRUPT91          ( ADS_EVT_DI_INTERRUPT0  + 91 )
#define ADS_EVT_DI_INTERRUPT92          ( ADS_EVT_DI_INTERRUPT0  + 92 )
#define ADS_EVT_DI_INTERRUPT93          ( ADS_EVT_DI_INTERRUPT0  + 93 )
#define ADS_EVT_DI_INTERRUPT94          ( ADS_EVT_DI_INTERRUPT0  + 94 )
#define ADS_EVT_DI_INTERRUPT95          ( ADS_EVT_DI_INTERRUPT0  + 95 )

#define ADS_EVT_DI_INTERRUPT96           ( ADS_EVT_DI_INTERRUPT0  + 96 )
#define ADS_EVT_DI_INTERRUPT97           ( ADS_EVT_DI_INTERRUPT0  + 97 )
#define ADS_EVT_DI_INTERRUPT98           ( ADS_EVT_DI_INTERRUPT0  + 98 )
#define ADS_EVT_DI_INTERRUPT99           ( ADS_EVT_DI_INTERRUPT0  + 99 )
#define ADS_EVT_DI_INTERRUPT100          ( ADS_EVT_DI_INTERRUPT0  + 100 )
#define ADS_EVT_DI_INTERRUPT101          ( ADS_EVT_DI_INTERRUPT0  + 101 )
#define ADS_EVT_DI_INTERRUPT102          ( ADS_EVT_DI_INTERRUPT0  + 102 )
#define ADS_EVT_DI_INTERRUPT103          ( ADS_EVT_DI_INTERRUPT0  + 103 )

#define ADS_EVT_DI_INTERRUPT104          ( ADS_EVT_DI_INTERRUPT0  + 104 )
#define ADS_EVT_DI_INTERRUPT105          ( ADS_EVT_DI_INTERRUPT0  + 105 )
#define ADS_EVT_DI_INTERRUPT106          ( ADS_EVT_DI_INTERRUPT0  + 106 )
#define ADS_EVT_DI_INTERRUPT107          ( ADS_EVT_DI_INTERRUPT0  + 107 )
#define ADS_EVT_DI_INTERRUPT108          ( ADS_EVT_DI_INTERRUPT0  + 108 )
#define ADS_EVT_DI_INTERRUPT109          ( ADS_EVT_DI_INTERRUPT0  + 109 )
#define ADS_EVT_DI_INTERRUPT110          ( ADS_EVT_DI_INTERRUPT0  + 110 )
#define ADS_EVT_DI_INTERRUPT111          ( ADS_EVT_DI_INTERRUPT0  + 111 )

#define ADS_EVT_DI_INTERRUPT112          ( ADS_EVT_DI_INTERRUPT0  + 112 )
#define ADS_EVT_DI_INTERRUPT113          ( ADS_EVT_DI_INTERRUPT0  + 113 )
#define ADS_EVT_DI_INTERRUPT114          ( ADS_EVT_DI_INTERRUPT0  + 114 )
#define ADS_EVT_DI_INTERRUPT115          ( ADS_EVT_DI_INTERRUPT0  + 115 )
#define ADS_EVT_DI_INTERRUPT116          ( ADS_EVT_DI_INTERRUPT0  + 116 )
#define ADS_EVT_DI_INTERRUPT117          ( ADS_EVT_DI_INTERRUPT0  + 117 )
#define ADS_EVT_DI_INTERRUPT118          ( ADS_EVT_DI_INTERRUPT0  + 118 )
#define ADS_EVT_DI_INTERRUPT119          ( ADS_EVT_DI_INTERRUPT0  + 119 )

#define ADS_EVT_DI_INTERRUPT120          ( ADS_EVT_DI_INTERRUPT0  + 120 )
#define ADS_EVT_DI_INTERRUPT121          ( ADS_EVT_DI_INTERRUPT0  + 121 )
#define ADS_EVT_DI_INTERRUPT122          ( ADS_EVT_DI_INTERRUPT0  + 122 )
#define ADS_EVT_DI_INTERRUPT123          ( ADS_EVT_DI_INTERRUPT0  + 123 )
#define ADS_EVT_DI_INTERRUPT124          ( ADS_EVT_DI_INTERRUPT0  + 124 )
#define ADS_EVT_DI_INTERRUPT125          ( ADS_EVT_DI_INTERRUPT0  + 125 )
#define ADS_EVT_DI_INTERRUPT126          ( ADS_EVT_DI_INTERRUPT0  + 126 )
#define ADS_EVT_DI_INTERRUPT127          ( ADS_EVT_DI_INTERRUPT0  + 127 )

#define ADS_EVT_DI_INTERRUPT136          ( ADS_EVT_DI_INTERRUPT0  + 136 )

#define ADS_EVT_DI_INTERRUPT160          ( ADS_EVT_DI_INTERRUPT0  + 160 ) 

#define ADS_EVT_DI_INTERRUPT184          ( ADS_EVT_DI_INTERRUPT0  + 184 ) 

// End of new device driver structure.


//  ...  ...
#define     ADS_EVT_INTERRUPT_IDI0_NAME		    "ADS_EVT_INTERRUPT_IDI0"
#define     ADS_EVT_INTERRUPT_IDI1_NAME		    "ADS_EVT_INTERRUPT_IDI1"
#define     ADS_EVT_INTERRUPT_IDI2_NAME		    "ADS_EVT_INTERRUPT_IDI2"
#define     ADS_EVT_INTERRUPT_IDI3_NAME		    "ADS_EVT_INTERRUPT_IDI3"
#define     ADS_EVT_INTERRUPT_IDI4_NAME		    "ADS_EVT_INTERRUPT_IDI4"
#define     ADS_EVT_INTERRUPT_IDI5_NAME		    "ADS_EVT_INTERRUPT_IDI5"
#define     ADS_EVT_INTERRUPT_IDI6_NAME		    "ADS_EVT_INTERRUPT_IDI6"
#define     ADS_EVT_INTERRUPT_IDI7_NAME		    "ADS_EVT_INTERRUPT_IDI7"
#define     ADS_EVT_INTERRUPT_IDI16_NAME	    "ADS_EVT_INTERRUPT_IDI16"
#define     ADS_EVT_INTERRUPT_IDI17_NAME	    "ADS_EVT_INTERRUPT_IDI17"

// sub group 0x3800 ~ 0x38ff for DI others Event ID
#define  ADS_EVT_FIFO_OVERFLOW_DI     0x3800
#define  ADS_EVT_FIFO_UNDERFLOW_DI    0x3801
#define  ADS_EVT_BUFFER1_FULL_DI      0x3802
#define  ADS_EVT_BUFFER2_FULL_DI      0x3803

//\\\\\\\\\\\\\\\\\\\\ 2.0C ///////////////////
#define  ADS_EVT_DI_LOBUFREADY        0x3804   
#define  ADS_EVT_DI_HIBUFREADY        0x3805   
#define  ADS_EVT_DI_TERMINATED        0x3810   
#define  ADS_EVT_DI_OVERRUN           0x3811   
#define  ADS_EVT_DI_PATTERNMATCH      0x3812   
#define  ADS_EVT_DI_STATUSCHANGE      0x3813 
////////////////////// 2.0C \\\\\\\\\\\\\\\\\\

// New driver structure
//New Event ID for DI Pattern Match. Max 32 ports.
#define ADS_EVT_DI_PATTERNMATCH_PORT0  0x3814
#define ADS_EVT_DI_PATTERNMATCH_PORT12 (ADS_EVT_DI_PATTERNMATCH_PORT0 + 12)
#define ADS_EVT_DI_PATTERNMATCH_PORT31 (ADS_EVT_DI_PATTERNMATCH_PORT0 + 31)
// DI Status Change Event Type: port 0 ~ port 31
#define ADS_EVT_DI_STATUSCHANGE_PORT0  0x3834
#define ADS_EVT_DI_STATUSCHANGE_PORT1  (ADS_EVT_DI_STATUSCHANGE_PORT0 + 1 )
#define ADS_EVT_DI_STATUSCHANGE_PORT13 (ADS_EVT_DI_STATUSCHANGE_PORT0 + 13)
#define ADS_EVT_DI_STATUSCHANGE_PORT31 (ADS_EVT_DI_STATUSCHANGE_PORT0 + 31)
// End of new driver structure


#define     ADS_EVT_FIFO_OVERFLOW_DI_NAME	    "ADS_EVT_FIFO_OVERFLOW_DI"
#define     ADS_EVT_FIFO_UNDERFLOW_DI_NAME	    "ADS_EVT_FIFO_UNDERFLOW_DI"
#define     ADS_EVT_BUFFER1_FULL_DI_NAME	    "ADS_EVT_BUFFER1_FULL_DI"
#define     ADS_EVT_BUFFER2_FULL_DI_NAME	    "ADS_EVT_BUFFER2_FULL_DI"
#define     ADS_EVT_DI_LOBUFREADY_NAME        "ADS_EVT_DI_LOBUFREADY"
#define     ADS_EVT_DI_HIBUFREADY_NAME        "ADS_EVT_DI_HIBUFREADY"
#define     ADS_EVT_DI_TERMINATED_NAME        "ADS_EVT_DI_TERMINATED"
#define     ADS_EVT_DI_OVERRUN_NAME           "ADS_EVT_DI_OVERRUN"
#define     ADS_EVT_DI_PATTERNMATCH_NAME      "ADS_EVT_DI_PATTERNMATCH"
#define     ADS_EVT_DI_STATUSCHANGE_NAME      "ADS_EVT_DI_STATUSCHANGE"

// ----------------------------------
// 0x4000 ~ 0x4fff for DO Group Event
// ----------------------------------
// sub group 0x4000 ~ 0x47ff for DO General Event ID

// sub group 0x4800 ~ 0x48ff for DO others Event ID
#define  ADS_EVT_FIFO_OVERFLOW_DO     0x4800
#define  ADS_EVT_FIFO_UNDERFLOW_DO    0x4801
#define  ADS_EVT_BUFFER1_EMPTY_DO     0x4802
#define  ADS_EVT_BUFFER2_EMPTY_DO     0x4803
//\\\\\\\\\\\\\\\\\\ 2.0C /////////////////
#define ADS_EVT_DO_LOBUFTRANS         0x4804
#define ADS_EVT_DO_HIBUFTRANS         0x4805
#define ADS_EVT_DO_TERMINATED         0x4810
#define ADS_EVT_DO_UNDERRUN           0x4811
//////////////////// 2.0C \\\\\\\\\\\\\\\\\/

#define     ADS_EVT_FIFO_OVERFLOW_DO_NAME	    "ADS_EVT_FIFO_OVERFLOW_DO"
#define     ADS_EVT_FIFO_UNDERFLOW_DO_NAME	    "ADS_EVT_FIFO_UNDERFLOW_DO"
#define     ADS_EVT_BUFFER1_EMPTY_DO_NAME	    "ADS_EVT_BUFFER1_EMPTY_DO"
#define     ADS_EVT_BUFFER2_EMPTY_DO_NAME	    "ADS_EVT_BUFFER2_EMPTY_DO"
#define     ADS_EVT_DO_LOBUFTRANS_NAME	       "ADS_EVT_DO_LOBUFTRANS"
#define     ADS_EVT_DO_HIBUFTRANS_NAME	       "ADS_EVT_DO_HIBUFTRANS"
#define     ADS_EVT_DO_TERMINATED_NAME	       "ADS_EVT_DO_TERMINATED"
#define     ADS_EVT_DO_UNDERRUN_NAME	       "ADS_EVT_DO_UNDERRUN"

// ---------------------------------------
// 0x5000 ~ 0x5fff for Counter/Timer Event 
// ---------------------------------------
// sub group 0x5000 ~ 0x50ff for Counter terminal count Event ID
#define  ADS_EVT_TERMINATE_CNT0       0x5000
#define  ADS_EVT_TERMINATE_CNT1       (ADS_EVT_TERMINATE_CNT0 + 1)
#define  ADS_EVT_TERMINATE_CNT2       (ADS_EVT_TERMINATE_CNT0 + 2)
#define  ADS_EVT_TERMINATE_CNT3       (ADS_EVT_TERMINATE_CNT0 + 3)
#define  ADS_EVT_TERMINATE_CNT4       (ADS_EVT_TERMINATE_CNT0 + 4)
#define  ADS_EVT_TERMINATE_CNT5       (ADS_EVT_TERMINATE_CNT0 + 5)
#define  ADS_EVT_TERMINATE_CNT6       (ADS_EVT_TERMINATE_CNT0 + 6)
#define  ADS_EVT_TERMINATE_CNT7       (ADS_EVT_TERMINATE_CNT0 + 7)
//  ...  ...
#define     ADS_EVT_TERMINATE_CNT0_NAME             "ADS_EVT_TERMINATE_CNT0"
#define     ADS_EVT_TERMINATE_CNT1_NAME             "ADS_EVT_TERMINATE_CNT1"
#define     ADS_EVT_TERMINATE_CNT2_NAME             "ADS_EVT_TERMINATE_CNT2"
#define     ADS_EVT_TERMINATE_CNT3_NAME             "ADS_EVT_TERMINATE_CNT3"
#define     ADS_EVT_TERMINATE_CNT4_NAME             "ADS_EVT_TERMINATE_CNT4"
#define     ADS_EVT_TERMINATE_CNT5_NAME             "ADS_EVT_TERMINATE_CNT5"
#define     ADS_EVT_TERMINATE_CNT6_NAME             "ADS_EVT_TERMINATE_CNT6"
#define     ADS_EVT_TERMINATE_CNT7_NAME             "ADS_EVT_TERMINATE_CNT7"

// sub group 0x5100 ~ 0x51ff for counter overflow Event ID
#define  ADS_EVT_OVERFLOW_CNT0        0x5100
#define  ADS_EVT_OVERFLOW_CNT1        (ADS_EVT_OVERFLOW_CNT0 + 1)
#define  ADS_EVT_OVERFLOW_CNT2        (ADS_EVT_OVERFLOW_CNT0 + 2)
#define  ADS_EVT_OVERFLOW_CNT3        (ADS_EVT_OVERFLOW_CNT0 + 3)
#define  ADS_EVT_OVERFLOW_CNT4        (ADS_EVT_OVERFLOW_CNT0 + 4)
#define  ADS_EVT_OVERFLOW_CNT5        (ADS_EVT_OVERFLOW_CNT0 + 5)
#define  ADS_EVT_OVERFLOW_CNT6        (ADS_EVT_OVERFLOW_CNT0 + 6)
#define  ADS_EVT_OVERFLOW_CNT7        (ADS_EVT_OVERFLOW_CNT0 + 7)
//  ...  ...
#define     ADS_EVT_OVERFLOW_CNT0_NAME              "ADS_EVT_OVERFLOW_CNT0"
#define     ADS_EVT_OVERFLOW_CNT1_NAME              "ADS_EVT_OVERFLOW_CNT1"
#define     ADS_EVT_OVERFLOW_CNT2_NAME              "ADS_EVT_OVERFLOW_CNT2"
#define     ADS_EVT_OVERFLOW_CNT3_NAME              "ADS_EVT_OVERFLOW_CNT3"
#define     ADS_EVT_OVERFLOW_CNT4_NAME              "ADS_EVT_OVERFLOW_CNT4"
#define     ADS_EVT_OVERFLOW_CNT5_NAME              "ADS_EVT_OVERFLOW_CNT5"
#define     ADS_EVT_OVERFLOW_CNT6_NAME              "ADS_EVT_OVERFLOW_CNT6"
#define     ADS_EVT_OVERFLOW_CNT7_NAME              "ADS_EVT_OVERFLOW_CNT7"

// sub group 0x5200 ~ 0x52ff for counter underflow Event ID
#define  ADS_EVT_UNDERFLOW_CNT0       0x5200
#define  ADS_EVT_UNDERFLOW_CNT1       (ADS_EVT_UNDERFLOW_CNT0 + 1)
#define  ADS_EVT_UNDERFLOW_CNT2       (ADS_EVT_UNDERFLOW_CNT0 + 2)
#define  ADS_EVT_UNDERFLOW_CNT3       (ADS_EVT_UNDERFLOW_CNT0 + 3)
#define  ADS_EVT_UNDERFLOW_CNT4       (ADS_EVT_UNDERFLOW_CNT0 + 4)
#define  ADS_EVT_UNDERFLOW_CNT5       (ADS_EVT_UNDERFLOW_CNT0 + 5)
#define  ADS_EVT_UNDERFLOW_CNT6       (ADS_EVT_UNDERFLOW_CNT0 + 6)
#define  ADS_EVT_UNDERFLOW_CNT7       (ADS_EVT_UNDERFLOW_CNT0 + 7)
//  ...  ...
#define     ADS_EVT_UNDERFLOW_CNT0_NAME             "ADS_EVT_UNDERFLOW_CNT0"
#define     ADS_EVT_UNDERFLOW_CNT1_NAME             "ADS_EVT_UNDERFLOW_CNT1"
#define     ADS_EVT_UNDERFLOW_CNT2_NAME             "ADS_EVT_UNDERFLOW_CNT2"
#define     ADS_EVT_UNDERFLOW_CNT3_NAME             "ADS_EVT_UNDERFLOW_CNT3"
#define     ADS_EVT_UNDERFLOW_CNT4_NAME             "ADS_EVT_UNDERFLOW_CNT4"
#define     ADS_EVT_UNDERFLOW_CNT5_NAME             "ADS_EVT_UNDERFLOW_CNT5"
#define     ADS_EVT_UNDERFLOW_CNT6_NAME             "ADS_EVT_UNDERFLOW_CNT6"
#define     ADS_EVT_UNDERFLOW_CNT7_NAME             "ADS_EVT_UNDERFLOW_CNT7"

// sub group 0x5300 ~ 0x53ff for counter OVER COMPARE Event ID
#define  ADS_EVT_OVERCOMPARE_CNT0     0x5300
#define  ADS_EVT_OVERCOMPARE_CNT1     (ADS_EVT_OVERCOMPARE_CNT0 + 1)
#define  ADS_EVT_OVERCOMPARE_CNT2     (ADS_EVT_OVERCOMPARE_CNT0 + 2)
#define  ADS_EVT_OVERCOMPARE_CNT3     (ADS_EVT_OVERCOMPARE_CNT0 + 3)
//  ...  ...
#define     ADS_EVT_OVERCOMPARE_CNT0_NAME           "ADS_EVT_OVERCOMPARE_CNT0"
#define     ADS_EVT_OVERCOMPARE_CNT1_NAME           "ADS_EVT_OVERCOMPARE_CNT1"
#define     ADS_EVT_OVERCOMPARE_CNT2_NAME           "ADS_EVT_OVERCOMPARE_CNT2"
#define     ADS_EVT_OVERCOMPARE_CNT3_NAME           "ADS_EVT_OVERCOMPARE_CNT3"

// sub group 0x5400 ~ 0x54ff for counter UNDER COMPARE Event ID
#define  ADS_EVT_UNDERCOMPARE_CNT0     0x5400
#define  ADS_EVT_UNDERCOMPARE_CNT1     (ADS_EVT_UNDERCOMPARE_CNT0 + 1)
#define  ADS_EVT_UNDERCOMPARE_CNT2     (ADS_EVT_UNDERCOMPARE_CNT0 + 2)
#define  ADS_EVT_UNDERCOMPARE_CNT3     (ADS_EVT_UNDERCOMPARE_CNT0 + 3)
//  ...  ...
#define     ADS_EVT_UNDERCOMPARE_CNT0_NAME          "ADS_EVT_UNDERCOMPARE_CNT0"
#define     ADS_EVT_UNDERCOMPARE_CNT1_NAME          "ADS_EVT_UNDERCOMPARE_CNT1"
#define     ADS_EVT_UNDERCOMPARE_CNT2_NAME          "ADS_EVT_UNDERCOMPARE_CNT2"
#define     ADS_EVT_UNDERCOMPARE_CNT3_NAME          "ADS_EVT_UNDERCOMPARE_CNT3"

// sub group 0x5500 ~ 0x55ff for GENERAL TIMER Event ID
#define  ADS_EVT_INTERRUPT_TIMER0     0x5500       
#define  ADS_EVT_INTERRUPT_TIMER1     (ADS_EVT_INTERRUPT_TIMER0 + 1)
#define  ADS_EVT_INTERRUPT_TIMER2     (ADS_EVT_INTERRUPT_TIMER0 + 2)
#define  ADS_EVT_INTERRUPT_TIMER3     (ADS_EVT_INTERRUPT_TIMER0 + 3)
#define  ADS_EVT_INTERRUPT_TIMER4     (ADS_EVT_INTERRUPT_TIMER0 + 4)
#define  ADS_EVT_INTERRUPT_TIMER5     (ADS_EVT_INTERRUPT_TIMER0 + 5)
#define  ADS_EVT_INTERRUPT_TIMER6     (ADS_EVT_INTERRUPT_TIMER0 + 6)
#define  ADS_EVT_INTERRUPT_TIMER7     (ADS_EVT_INTERRUPT_TIMER0 + 7)
//\\\\\\\\\\\\\\\\\ 2.0C ////////////////
#define  ADS_EVT_TC_TIMER             0x5200    
/////////////////// 2.0C \\\\\\\\\\\\\\\\


//  ...  ...
#define     ADS_EVT_INTERRUPT_TIMER0_NAME          "ADS_EVT_INTERRUPT_TIMER0"
#define     ADS_EVT_INTERRUPT_TIMER1_NAME          "ADS_EVT_INTERRUPT_TIMER1"
#define     ADS_EVT_INTERRUPT_TIMER2_NAME          "ADS_EVT_INTERRUPT_TIMER2"
#define     ADS_EVT_INTERRUPT_TIMER3_NAME          "ADS_EVT_INTERRUPT_TIMER3"
#define     ADS_EVT_INTERRUPT_TIMER4_NAME          "ADS_EVT_INTERRUPT_TIMER4"
#define     ADS_EVT_INTERRUPT_TIMER5_NAME          "ADS_EVT_INTERRUPT_TIMER5"
#define     ADS_EVT_INTERRUPT_TIMER6_NAME          "ADS_EVT_INTERRUPT_TIMER6"
#define     ADS_EVT_INTERRUPT_TIMER7_NAME          "ADS_EVT_INTERRUPT_TIMER7"
#define     ADS_EVT_TC_TIMERNAME                   "ADS_EVT_TC_TIMER"

// sub group 0x5800 ~ 0x58ff for COUNTER/TIMER others Event ID
#define  ADS_EVT_INDEX_CNT0           0x5800
#define  ADS_EVT_INDEX_CNT1           (ADS_EVT_INDEX_CNT0 + 1)
#define  ADS_EVT_INDEX_CNT2           (ADS_EVT_INDEX_CNT0 + 2)
#define  ADS_EVT_INDEX_CNT3           (ADS_EVT_INDEX_CNT0 + 3)
//  ... ...
#define  ADS_EVT_INDEX_CNT0_NAME                   "ADS_EVT_INDEX_CNT0"
#define  ADS_EVT_INDEX_CNT1_NAME                   "ADS_EVT_INDEX_CNT1"
#define  ADS_EVT_INDEX_CNT2_NAME                   "ADS_EVT_INDEX_CNT2"
#define  ADS_EVT_INDEX_CNT3_NAME                   "ADS_EVT_INDEX_CNT3"

// Event closed
#define  ADS_EVT_DEVICE_CLOSED        0xfffe


#endif
